<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
</head>
<body>
  <div id="app">
    姓名：
    <input :value="name" placeholder="请输入"
      @keyup="inputChange($event)"
      />
  </div>
  <script>


    var app = new Vue({
      el: '#app',
      data: {
        message: 'hello Vue!',
        name: ''
      },
      methods: {
        inputChange(e) {
          const o = e.target;
          o.value = o.value.replace(/[^\u4E00-\u9FA5]/g, ''); // 清除除了中文以外的输入的字符
    　　　this.name = o.value;
        },
      },
    })
  </script>
</body>
</html>